package com.eastjet.equipment.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastjet.equipment.service.DeviceExecutionService;
import com.eastjet.maintenance.domain.DeviceExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/execution")
public class DeviceExecutionConroller {

    @Autowired
    private DeviceExecutionService deviceExecutionService;

    @GetMapping("/executionList")
    public Page<DeviceExecution> executionList(
            @RequestParam(defaultValue = "")int page,
            @RequestParam(defaultValue = "")int size,
            @RequestParam(defaultValue = "")String condition
            ){
        System.out.println("executionPage:"+page);
        System.out.println("executionPage:"+size);
        System.out.println("executionPage:"+condition);
        return deviceExecutionService.getExecutionList(page,size,condition);
    }
}
